<template>
  <div>
    <el-container>
      <el-header>
        <div class="line"></div>
        <el-menu
          :default-active="activeIndex2"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          router
        >
          <el-menu-item index="/shouye">首页</el-menu-item>
          <el-menu-item index="2">商品</el-menu-item>
          <el-menu-item index="3">订单</el-menu-item>
          <el-menu-item index="4">会员</el-menu-item>
          <el-menu-item index="5">设置</el-menu-item>
          <el-menu-item>
            <el-button type="primary" @click="goback">退出登录</el-button>
          </el-menu-item>
        </el-menu>
      </el-header>
      <el-container>
        <el-aside width="250px">
          <el-row class="tac">
            <el-col :span="12">
              <!-- <h5>默认颜色</h5> -->
              <el-menu default-active="1" class="el-menu-vertical-demo" router>
                <el-menu-item index="/Guanmanagement">
                  <i class="el-icon-menu"></i>
                  <span slot="title">后台首页</span>
                </el-menu-item>
                <el-menu-item index="2">
                  <i class="el-icon-menu"></i>
                  <span slot="title">相册管理</span>
                </el-menu-item>
                <el-menu-item index="/Shopmanagement">
                  <i class="el-icon-setting"></i>
                  <span slot="title">商品列表</span>
                </el-menu-item>
              </el-menu>
            </el-col>
          </el-row>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: "1",
      activeIndex2: "1",
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    goback(){
      console.log(1111);
      localStorage.removeItem("token")
      alert("退出登录")
      this.$router.push("/login")
    }
  },
};
</script>

<style>
</style>
